package com.lwj.liwanjia.presenter;

import com.lwj.liwanjia.bean.QuerenBean;
import com.lwj.liwanjia.impl.QuerenView;
import com.lwj.liwanjia.model.QuerenModel;

import retrofit2.http.Query;
import rx.Subscriber;

/**
 * Created by Administrator on 2017/10/19.
 */

public class QuerenIndentPresenter {
    private QuerenView querenView;
    private QuerenModel querenModel;

    public QuerenIndentPresenter(QuerenView querenView) {
        this.querenView = querenView;
        querenModel = new QuerenModel();
    }

    public void querenIndent(String token, String tradeId) {
        if (querenView != null) {
            querenModel.querenIndent(token, tradeId, new Subscriber<QuerenBean>() {
                @Override
                public void onCompleted() {

                }

                @Override
                public void onError(Throwable e) {
                    querenView.showError((Exception) e);
                }

                @Override
                public void onNext(QuerenBean querenBean) {
                    querenView.querenIndent(querenBean);
                }
            });
        }
    }
}
